import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.InputStreamReader;

public class IOFile {

	public static boolean deleteObject(String path) {
		File paraBorrar = new File(path);
		paraBorrar.delete();
		return true;

	}

	public static boolean writeFile(String text, String as, String extencion) {
		try {
			BufferedWriter bw = new BufferedWriter(new FileWriter(new File(
					"F:\\" + as + "." + extencion)));
			bw.write(text);
			bw.newLine();
			bw.close();
			return true;

		} catch (Exception e) {
			return false;
		}
	}

	public static boolean readFile(String as, String extencion) {
		try {
			InputStream is = new FileInputStream("f:\\" + as + "." + extencion);
			BufferedReader br = new BufferedReader(new InputStreamReader(is));
			String line;
			while ((line = br.readLine()) != null) {
				System.out.println(line);
			}
			br.close();
			return true;
		} catch (Exception e) {
			return false;
		}
	}

}
